#include "stdafx.h"
#include "faultdiagnosis.h"

FaultDiagnosis::FaultDiagnosis(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::FaultDiagnosisClass())
{
    ui->setupUi(this);
	QVBoxLayout *vLayout = new QVBoxLayout(ui->widget);
	vLayout->setMargin(0);
	vLayout->setSpacing(0);
	ui_deviceinfo = new QtDeviceInfo(ui->widget);
	ui_deviceinfo->show();
	vLayout->addWidget(ui_deviceinfo);
	ui_acquisition = new QtAcquisition(ui->widget);
	ui_acquisition->hide();
	ui_acquisition->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	vLayout->addWidget(ui_acquisition);
	connect(ui->btn_deviceInfo, &QPushButton::clicked, this, &FaultDiagnosis::btn_deviceinfo_clicked);
	connect(ui->btn_dataAcquire, &QPushButton::clicked, this, &FaultDiagnosis::btn_acquisition_clicked);
}

FaultDiagnosis::~FaultDiagnosis()
{
    delete ui;
}

void FaultDiagnosis::btn_deviceinfo_clicked()
{
	ui_deviceinfo->show();
	ui_acquisition->hide();
}

void FaultDiagnosis::btn_acquisition_clicked()
{
	ui_deviceinfo->hide();
	ui_acquisition->show();
}
